const app = new Vue({
  el: '#app',
  data: {

      baseURL:'http://192.168.3.200:8000/',
      students: [],

                 total:100,
                 currentPage:1,
                 pagesizes:10,
  },

  mounted(){
    this.getStudents();
  },


  methods:{
      getStudents:function () {
        //this  save
        let that = this
              axios
              .get(that.baseURL +'students/')
              .then(function(res){
                //请求成功后执行的函数
                if (res.data.code===1){
                  that.students=res.data.data;
                  that.$message({
                    showClose: true,
                    message: '恭喜你，这是一条成功消息',
                    type: 'success'
                  });
                }else{
                  that.$message({
                    showClose: true,
                    message: '错了哦，这是一条错误消息'+res.data.msg,
                    type: 'error'
                  });
                }

              })
              .catch(function(err){
                //请求失败后执行的函数
                console.log(err)
              });

            },


          },
 })

